<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改物联网终端')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-ioterminal-edit" th:object="${tbIoterminal}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required" >MIME：</label>
                <div class="col-sm-8">
                    <input name="imei" th:field="*{imei}" class="form-control" type="text" required readonly>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label" >类型：</label>
                <div class="col-sm-8">
                    <select name="ctype" th:field="*{ctype}" th:with="type=${@dict.getType('iot_devType')}" disabled="disabled">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label" disabled="disabled">IP地址：</label>
                <div class="col-sm-8">
                    <input name="conip" th:field="*{conip}" class="form-control" type="text" disabled="disabled">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-4 control-label" style="color: red">当前数据接收状态：</label>
                <div class="col-sm-8">
                    <select name="status" th:field="*{status}">
                        <option value="1">允许接收</option>
                        <option value="0">停止接收</option>
                    </select>
                </div>

            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label" disabled="disabled">安装时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="startdate" disabled="disabled" th:value="${#dates.format(tbIoterminal.startdate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label" disabled="disabled">更换时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="exdate" disabled="disabled" th:value="${#dates.format(tbIoterminal.exdate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required" disabled="disabled">存放地址：</label>
                <div class="col-sm-8">
                    <div class="input-group">
                        <input name="deptName" disabled="disabled" th:field="*{deptid}" onclick="selectDeptTree()" id="treeName" type="text" placeholder="请选择存放地址" class="form-control" required>
                        <span class="input-group-addon"><i class="fa fa-search"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group" hidden>
                <label class="col-sm-3 control-label is-required" disabled="disabled">录入人编号：</label>
                <div class="col-sm-8">
                    <input name="uid" disabled="disabled" th:field="*{uid}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label" disabled="disabled">备注：</label>
                <div class="col-sm-8">
                    <input name="demo" disabled="disabled" th:field="*{demo}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label" readonly>是否在线：</label>
                <div class="col-sm-8">
                    <select name="online" disabled="disabled" th:field="*{online}">
                        <option value="1">在线</option>
                        <option value="0">不在线</option>
                    </select>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script type="text/javascript">
        var prefix = ctx + "system/iotContro";
        $("#form-ioterminal-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/comf", $('#form-ioterminal-edit').serialize());
            }
        }

        $("input[name='startdate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='exdate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>